package org.pentaho.cubic.client.perspective.filedetails;

import org.pentaho.cubic.client.perspective.fileproperties.FileItem;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

public class CubicFileDetails extends Composite {

	private static CubicFileDetails instance;
	private FileItem file;
	
	private static CubicFileDetailsUiBinder uiBinder = GWT
			.create(CubicFileDetailsUiBinder.class);

	interface CubicFileDetailsUiBinder extends
			UiBinder<Widget, CubicFileDetails> {
	}
	
	@UiField SimplePanel panel;
	@UiField Button btnOpen;
	@UiField Button btnEdit;
	@UiField Button btnDelete;
	@UiField Button btnShare;
	@UiField Button btnSchedule;
	
	public CubicFileDetails() {
		initWidget(uiBinder.createAndBindUi(this));
	}
	
	public void setFileDetails(FileItem file) {
		this.file = file;
		DetailWrapper wrapper = new DetailWrapper(file);
		panel.setWidget(wrapper);
	}
	
	public static CubicFileDetails getInstance(){
		if (instance == null) {
			instance = new CubicFileDetails();
		}
		return instance;
	}
	
	

}
